GO_VERSION ?= 1.18.3
GOOS ?= linux
GOARCH ?= amd64
GOPATH ?= $(shell go env GOPATH)

.DEFAULT_GOAL := help
.PHONY: help
help:
	@awk 'BEGIN { \
		FS = ":.*##"; \
		printf "\nUsage:\n  make \033[36m<target>\033[0m\n"\
	} \
	/^[a-zA-Z_-]+:.*?##/ { \
		printf "  \033[36m%-17s\033[0m %s\n", $$1, $$2 \
	} \
	/^##@/ { \
		printf "\n\033[1m%s\033[0m\n", substr($$0, 5) \
	} ' $(MAKEFILE_LIST)


.PHONY: all
all:  enode center euplink ##构建所有


.PHONY: enode
enode:  ## 构建enode
	@echo "Running ${@}"
	go build -o ./node enode/cmd/enode/main.go

.PHONY: center
center: ## 编译构建构建center
	@echo "Running ${@}"
	go build  -o ./ecenter center/cmd/center/main.go


.PHONY: euplink
euplink: ## 编译构建euplink
	@echo "Running ${@}"
	go build -o ./uplink euplink/cmd/euplink/.
